package com.ming.springboot.util;

import freemarker.template.utility.StringUtil;

import java.util.Random;

/**
 * Created by mqsi on 2022/5/18 19:50
 */
public class StudentDataUtil {
	private static String[] addressArray = {"北京市", "上海市", "深圳", "杭州", "济南", "青岛", "武汉", "西安"};
	private static String[] firstNameArray = {"赵", "钱", "孙", "李", "周", "吴", "郑", "王", "陈", "司", "诸葛"};
	private static String[] secondNameArray = {"娜", "浩民", "静", "伟", "超", "海波", "波", "云航", "志", "康", "凌云", "壮志"};

	public static String getAddress(){
		Random random = new Random();
		int index = random.nextInt(addressArray.length);
		return addressArray[index];
	}

	public static String getSName(){
		Random random = new Random();
		String firstName = firstNameArray[random.nextInt(firstNameArray.length)];
		String secondeName = secondNameArray[random.nextInt(secondNameArray.length)];
		return firstName +  secondeName;
	}

	public static String getSno(){
		Random random = new Random();
		return "888" + StringUtil.leftPad((random.nextInt(10000)+1)+"", 6, "0");
	}

	public static Integer getAge(){
		Random random = new Random();
		return random.nextInt(10) + 21;
	}

	public static void main(String[] args) {
		for (int i = 0; i < 10; i++) {
			System.out.println(getAge());
		}
	}
}
